home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / misc / ada1110b.lha / Examples / Dine / winspec.ada < prev   
Encoding:
Text File  |  1992-03-02  |  2.6 KB  |  88 lines

  1. with TEXT_IO, VT100; use TEXT_IO, VT100;
  2. PACKAGE Windows IS 
  3.  
  4. -- Simple output-only window manager for 24x80 terminals.
  5. -- Adapted by
  6. -- Michael B. Feldman, The George Washington University, November 1990.
  7.  
  8.    
  9.    ScreenRows : constant integer := 24;
  10.    ScreenColumns : constant integer := 80;
  11.  
  12.    TYPE WINDOW is private;
  13.    
  14.    SUBTYPE RowRange  is integer range 1.. ScreenRows;
  15.    SUBTYPE ColRange  is integer range 1.. ScreenColumns;
  16.    SUBTYPE RowLength is integer range 1.. ScreenRows;
  17.    SUBTYPE ColLength is integer range 1.. ScreenColumns;
  18.         
  19.         
  20.    PROCEDURE Open (  w: in out WINDOW;          -- Window variable returned 
  21.                        row   : RowRange;        -- Upper left corner        
  22.                        column: ColRange;
  23.                        height: RowLength;       -- Size of window           
  24.                        width : ColLength);
  25.  
  26.    -- Create a window variable and open the window for writing.  
  27.    -- No checks for overlap of windows are made. 
  28.    
  29.       
  30.    PROCEDURE Close (  w: in out WINDOW);
  31.    -- Close window and clear window variable. 
  32.    
  33.    
  34.    PROCEDURE Title (w     : in out WINDOW;
  35.                     name  : STRING;
  36.                     under : CHARACTER);
  37.  
  38.    -- Put a title name at the top of the window.  If the parameter 
  39.    -- under <> 0C or ' ', underline the title with the specified character. 
  40.       
  41.       
  42.    PROCEDURE Borders (w   : in out WINDOW;
  43.                       corner, down, across: CHARACTER);
  44.  
  45.    -- Draw border around current writable area in window with characters
  46.    -- specified.  Call this BEFORE Title.  
  47.    
  48.    
  49.    PROCEDURE GotoRowColumn (w    : in out WINDOW;
  50.                             row  : RowRange;
  51.                             column : ColRange);
  52.  
  53.    -- Goto the row and column specified.  Coordinates are relative to the
  54.    -- upper left corner of window, which is (1, 1) 
  55.    
  56.    
  57.    PROCEDURE put (w: in out WINDOW; ch: CHARACTER);
  58.  
  59.    -- put one character to the window.
  60.    -- If end of column, go to the next row.
  61.    -- If end of window, go to the top of the window. 
  62.    
  63.    
  64.    PROCEDURE put_string (w: in out WINDOW;
  65.                           s: STRING);
  66.  
  67.    -- put a string to window. 
  68.  
  69.  
  70.    PROCEDURE new_line (w: in out WINDOW);
  71.  
  72.    -- Go to beginning of next line.  Next line is
  73.    -- not blanked until next character is written  
  74.  
  75.  
  76.    PRIVATE
  77.       type WINDOW is 
  78.           RECORD
  79.              CurrentRow,                  -- Current cursor row 
  80.              firstrow,
  81.              lastrow      : RowRange;
  82.              CurrentColumn,               -- Current cursor column 
  83.              firstcolumn,
  84.              lastcolumn    : ColRange;
  85.           END RECORD;
  86.  
  87. END Windows;
  88.